//
//  EDSPlayerView.m
//  DrivieSchoolStudents
//
//  Created by TangBin on 2019/5/24.
//  Copyright © 2019 班文政. All rights reserved.
//

#import "EDSPlayerView.h"
#import "EDSOverlayView.h"

@interface EDSPlayerView ()

@property (nonatomic, strong) EDSOverlayView *overlayView;

@end

@implementation EDSPlayerView

+ (Class)layerClass
{
    return [AVPlayerLayer class];
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self setupUI];
    }
    return self;
}

//- (instancetype)init
//{
//    if (self = [super init])
//    {
//        [self setupUI];
//    }
//    return self;
//}

- (void)setupUI
{
    self.overlayView = [[EDSOverlayView alloc] initWithFrame:self.bounds];
    [self addSubview:self.overlayView];
}

- (AVPlayer *)player
{
    return [(AVPlayerLayer *)[self layer] player];
}

- (void)setPlayer:(AVPlayer *)player
{
    [(AVPlayerLayer *)[self layer] setPlayer:player];
}

- (id<EDSPlayTransport>)transport
{
    return self.overlayView;
}


@end




























